<extend name="Public:base" />

<block name="head">
	<title>商品主页</title>
</block>

<block name="body">
	<p align="center">
		<h2>商品主页</h2>
		<a href="./add.html">添加页</a>
	</p>
	<table border="1" width="100%">
		<form action="index" method="post">
			<tr height="50px">
				<td colspan="9" align="center">
					<select name="cate_condition">
						<option value="0">所有分类</option>
						<volist name="cate" id="vo">
							<option value="{$vo.id}" <eq name="Think.post.cate_condition" value="$vo.id">selected="selected"</eq>>|{$vo.lev|str_repeat='--',###}{$vo.c_name}</option>
						</volist>
					</select>
					<select name="is_sale">
						<option value="0">选择上架</option>
						<option value="1" <eq name="Think.post.is_sale" value="1">selected="selected"</eq>>上架</option>
						<option value="2" <eq name="Think.post.is_sale" value="2">selected="selected"</eq>>未上架</option>
					</select>
					<select name="attribute">
						<option>选择属性</option>
						<option value="is_hot" <eq name="Think.post.attribute" value="is_hot">selected="selected"</eq>>推荐</option>
						<option value="is_rec" <eq name="Think.post.attribute" value="is_rec">selected="selected"</eq>>热卖</option>
						<option value="is_new" <eq name="Think.post.attribute" value="is_new">selected="selected"</eq>>新品</option>
					</select>
					<input type="text" name="goods_name" placeholder="请输入商品关键字" value="{$Think.post.goods_name}">
					<input type="submit" value="查询">
					<input type="reset" value="重置">
				</td>
			</tr>
		</form>
		<tr>
			<th>编号</th>
			<th>商品名称</th>
			<th>货号</th>
			<th>价格</th>
			<th>上架</th>
			<th>推荐</th>
			<th>热销</th>
			<th>新品</th>
			<th>操作</th>
		</tr>
		<volist name="data.data" id="vo">
			<tr align="center">
				<td>{$vo.id}</td>
				<td>{$vo.goods_name}</td>
				<td>{$vo.goods_sn}</td>
				<td>{$vo.shop_price}</td>

				<td>
					<eq name="vo.is_sale" value="1">
						是<else />否
					</eq>
				</td>
				<td>
					<eq name="vo.is_hot" value="1">
						是<else />否
					</eq>
				</td>
				<td>
					<eq name="vo.is_rec" value="1">
						是<else />否
					</eq>
				</td>
				<td>
					<eq name="vo.is_new" value="1">
						是<else />否
					</eq>
				</td>
				<td>
					<a href="{:U('edit','id='.$vo['id'])}">编辑</a>
					<a href="{:U('dels','id='.$vo['id'])}">删除</a>
				</td>
			</tr>
		</volist>
		<tr>
			<td colspan="9">
			    {$data.pageStr}
			</td>
		</tr>
	</table>
</block>
